home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
VISUALBA
/
BV0687.ZIP
/
BV0687.TXT
Wrap
Text File
|
1993-01-10
|
17KB
|
398 lines
======================================================================
Microsoft Product Support Services Application Note (Text File)
BV0687: HOW TO USE CALL INTERRUPT
======================================================================
Revision Date: 11/92
No Disk Included
The following information applies to Microsoft Basic Languages
versions (see below).
--------------------------------------------------------------------
| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY |
| ACCOMPANY THIS DOCUMENT (collectively referred to as an |
| Application Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY |
| KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO |
| THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A |
| PARTICULAR PURPOSE. The user assumes the entire risk as to the |
| accuracy and the use of this Application Note. This Application |
| Note may be copied and distributed subject to the following |
| conditions: 1) All text must be copied without modification and |
| all pages must be included; 2) If software is included, all files |
| on the disk(s) must be copied without modification [the MS-DOS(R) |
| utility DISKCOPY is appropriate for this purpose]; 3) All |
| components of this Application Note must be distributed together; |
| and 4) This Application Note may not be distributed for profit. |
| |
| Copyright 1989-1992 Microsoft Corporation. All Rights Reserved. |
| Microsoft and MS-DOS are registered trademarks and Microsoft |
| QuickBasic, Visual Basic, and Windows are trademarks of Microsoft |
| Corporation. OS/2 is a registered trademark licensed to Microsoft |
| Corporation. |
--------------------------------------------------------------------
INTRODUCTION
============
The information in this application note applies to:
- The Standard and Professional Editions of Microsoft Visual Basic
for MS-DOS, version 1.0
- Microsoft QuickBasic for MS-DOS, versions 4.0, 4.0b, and 4.5
- Microsoft Basic Compiler for MS-DOS, versions 6.0 and 6.0b
- Microsoft Basic Professional Development System (PDS) for MS-DOS,
versions 7.0 and 7.1
The information in this application note is also included in the Help
file provided with the Standard and Professional Editions of Microsoft
Visual Basic for MS-DOS, version 1.0.
The CALL INTERRUPT and CALL INTERRUPTX statements documented in this
application note are similar to the CALL INT86 and CALL INT86X
statements supported in Microsoft QuickBasic for MS-DOS, versions 2.0,
2.01, and 3.0. The CALL INT86 and CALL INT86X statements also provide
access to the ROM BIOS and MS-DOS interrupts but use an array
interface instead of user-defined TYPEs. CALL INT86 and CALL INT86X
are documented on pages 148-149 of the "Microsoft QuickBASIC Compiler"
manual for versions 2.0, 2.01, and 3.0. Although there are
differences, some of the information in this application note will be
useful to those who use Microsoft QuickBasic for MS-DOS, versions 2.0,
2.01, and 3.0.
CALL INTERRUPT is a complicated statement that allows programmers to
access low-level MS-DOS and ROM BIOS interrupts and to control these
interrupts from Basic. Effective use of the complex CALL INTERRUPT
interface requires an understanding of the Basic programming
environment, the Basic language, and lower-level MS-DOS and ROM BIOS
functions. This application note explains some of these topics,
including the following:
1. Libraries and Quick libraries
2. User-defined TYPEs
3. INCLUDE files
4. CALL INTERRUPT input and output
5. Differences between CALL INTERRUPT and CALL INTERRUPTX
The CALL INTERRUPT statement is designed to call only MS-DOS
interrupts and is not supported in MS OS/2(R) protected mode. Most of
the functions provided by MS-DOS interrupts are available in MS OS/2
protected mode, but are accessed through application programming
interface (API) calls. Most interrupts will work correctly in MS OS/2
real mode (the MS-DOS version 3.x box).
LIBRARIES AND QUICK LIBRARIES
=============================
The object code for the interrupt routines is located in the
VBDOS.LIB, VBDOS.QLB, QB.LIB, QB.QLB, QBX.LIB, and QBX.QLB files,
which are supplied with Visual Basic for MS-DOS, version 1.0;
Microsoft QuickBasic for MS-DOS, versions 4.0, 4.0b, and 4.5; Basic
Compiler for MS-DOS, versions 6.0 and 6.0b; and Basic Professional
Development System (PDS) for MS-DOS, versions 7.0 and 7.1.
The difference between LINK libraries (.LIB files) and Quick libraries
(.QLB files) is that Quick libraries serve as executable code modules
for use within the Visual Basic for MS-DOS or Microsoft QuickBasic
programming environments, whereas LINK libraries are used at link time
to produce executable programs.
To load a Quick library for use with the Visual Basic for MS-DOS or
Microsoft QuickBasic programming environments, you must start Visual
Basic for MS-DOS or Microsoft QuickBasic with the /L option (that is,
"VBDOS /L VBDOS.QLB" or "QB /L QB.QLB" or "QBX /L QBX.QLB"). This will
allow you to make CALLs to the routines in that Quick library. When
you choose Make EXE File from the Run menu, your program will
automatically be linked with the library (.LIB file) of the same name
as your Quick library (in this case, VBDOS.LIB, QB.LIB, or QBX.LIB).
USER-DEFINED TYPES
==================
To use the CALL INTERRUPT statement, you must first create a user-
defined TYPE to contain the registers for the interrupt. The TYPEs are
defined in the INCLUDE file (VBDOS.BI, QB.BI, or QBX.BI) that comes
with Visual Basic for MS-DOS, version 1.0; with Microsoft QuickBasic
for MS-DOS, versions 4.0, 4.0b, and 4.5; and Basic PDS for MS-DOS,
versions 7.0 and 7.1. For example:
TYPE RegType
ax AS INTEGER
bx AS INTEGER
cx AS INTEGER
dx AS INTEGER
bp AS INTEGER
si AS INTEGER
di AS INTEGER
flags AS INTEGER
END TYPE
TYPE RegTypeX ' See Note below.
ax AS INTEGER
bx AS INTEGER
cx AS INTEGER
dx AS INTEGER
bp AS INTEGER
si AS INTEGER
di AS INTEGER
flags AS INTEGER
ds AS INTEGER
es AS INTEGER
END TYPE
NOTE: RegTypeX is used with the CALL INTERRUPTX statement, which
allows you to specify the DS and ES registers. For more information
on CALL INTERRUPTX, please refer to the section "Differences Between
CALL INTERRUPT and CALL INTERRUPTX" later in this application note.
INCLUDE FILES
=============
To simplify the TYPE definition for interrupts, the INCLUDE file
VBDOS.BI, QB.BI, or QBX.BI is shipped with Visual Basic for MS-DOS,
version 1.0; with Microsoft QuickBasic for MS-DOS, versions 4.0, 4.0b,
and 4.5; with Basic Compiler for MS-DOS, versions 6.0 and 6.0b; and
with Basic PDS for MS-DOS, versions 7.0 and 7.1. VBDOS.BI, QB.BI, and
QBX.BI have the TYPE definitions (see a TYPE example later in this
application note) and SUB declarations needed for the interrupt. To
use this file, place the metacommand $INCLUDE at the beginning of your
code.
Use the following $INCLUDE statement for Visual Basic for MS-DOS:
REM $INCLUDE: 'VBDOS.BI'
Use the following $INCLUDE statement for Microsoft QuickBasic for
MS-DOS:
REM $INCLUDE: 'QB.BI'
Use the following $INCLUDE statement for Basic PDS for MS-DOS:
REM $INCLUDE: 'QBX.BI'
Please note the following:
- The $INCLUDE m